class ShieldCard extends BaseCard{
	/**伤害类型 */
	protected defTypes:WeaponType[]
	/**防御位置， -1=左一格， 0=放置格， 1=右一格 */
	protected defPlace:(-1|0|1)[]
	protected defPlace2:(0|1|2)[]
	public constructor(data:ICardData) {
		super(data)
		this.defPlace = data['dp'] as (-1|0|1)[]
	}

	public finishMoving(){
		super.finishMoving()
		let dpArr:(0|1|2)[] = []
		const p = this.curPlace
		for(let dp of this.defPlace){
			const ndp = dp + p.j
			if(ndp < 0 || ndp > 2) continue
			dpArr.push(ndp as (0|1|2))
		}
		this.defPlace2 = dpArr
	}

	public checkDefensable(weapon:WeaponCard):boolean{
		const t = this
		/**无法防御的伤害类型 */
		if(t.defenceTypes.indexOf(weapon.damageType)<0) return false
		/**无法防御的位置 */
		if(t.defPlace2.indexOf(weapon.curPlace.j as (0|1|2))<0) return false
		return true
	}

	public get defenceTypes(){
		return this.defTypes
	}
}